package dnl.dtools.grm;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;

import ajul.lang.Args;

/**
 * Describes a semantic 'unreal' resource. 
 *  
 * @author Daniel Ore
 */
public class ResourceAlias extends Resource {

	private String alias;
	private Resource delegate;
	
	public ResourceAlias(Resource original, String alias) {
		super(original.getUrl());
		Args.assertNotNull(alias);
		this.alias = alias;
		this.delegate = original;
	}

	public boolean delete() throws IOException {
		return delegate.delete();
	}

	public boolean equals(Object arg0) {
		return delegate.equals(arg0);
	}

	public boolean exists() {
		return delegate.exists();
	}

	public Resource getChild(String name) {
		return delegate.getChild(name);
	}

	public InputStream getInputStream() throws IOException {
		return delegate.getInputStream();
	}

	public long getLastModified() {
		return delegate.getLastModified();
	}

	public String getName() {
		return alias;
	}

	public OutputStream getOutputStream() throws IOException {
		return delegate.getOutputStream();
	}

	public Resource getParent() {
		return delegate.getParent();
	}

	public long getSize() {
		return delegate.getSize();
	}

	public URL getUrl() {
		return delegate.getUrl();
	}

	public int hashCode() {
		return delegate.hashCode();
	}

	public boolean isArchive() {
		return delegate.isArchive();
	}

	public boolean isArchiveEntry() {
		return delegate.isArchiveEntry();
	}

	public boolean isDirectory() {
		return delegate.isDirectory();
	}

	public boolean isHidden() {
		return delegate.isHidden();
	}

	public boolean isLocal() {
		return delegate.isLocal();
	}

	public Resource[] list() throws ResourceExtractionException {
		return delegate.list();
	}

	public boolean mkDir() throws IOException {
		return delegate.mkDir();
	}

	public boolean renameTo(Resource dest) throws IOException {
		return delegate.renameTo(dest);
	}

	public String toString() {
		return delegate.toString();
	}

	
}
